package com.keeping.aiimagery.mapper;

import com.keeping.aiimagery.entity.LoginDto;
import com.keeping.aiimagery.entity.UpdataVo;
import com.keeping.aiimagery.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * 用户 Mapper 接口
 * </p>
 *
 * @author keeping
 * @since 2023-04-05
 */
public interface UserMapper extends BaseMapper<User> {
    //修改积分
    public void updataById(UpdataVo updataVo);
    //获得积分值
    public Integer getIntegralById(@Param("userAccount") String userAccount);

    //通过account找id
    public Integer findIdByAccount(@Param("userAccount") String userAccount);
    void insert(@Param("username") String username, @Param("password") String password, @Param("phone") String phone, @Param("invitationCode") String invitationCode);
    //扣减积分
    public Integer cut(@Param("userId") Integer userId,@Param("integral") Integer integral);
    User login(String userAccount);
    // 通过邀请码找id
    public Integer findByYaoqingma(@Param("invitationCode") String invitationCode);
    public void updataByInvite(UpdataVo updataVo);
    public String findphone(String phone);
    public User getmsg(String phone);

    public void updateconsume(@Param("integral") Integer integral,@Param("remain") Integer remain,@Param("userId") String userId);

    public void updateconsumecount(@Param("integral") Integer integral, @Param("remaincount") Integer remaincount, @Param("userId") String userId);

    public void updateconsumestorage(@Param("integral") Integer integral, @Param("remainstorage") Integer remainstorage, @Param("userId") String userId);

}
